Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make local variables out of nn.sequential members for onnx exportability #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fuzic
Copy link

@fuzic fuzic commented Jul 9, 2018

The pytorch onnx exporter doesn't work if parameters are included as members of two modules. This means the pattern of having self.operator and passing self.operator to nn.sequential breaks the ability to export an onnx model.

This updates the TCN network to mirror the implementation of many other networks in pytorch where the operators passed to nn.Sequential are all local variables, and weight initialization is done at construction time to avoid the need for member variables for everything.

Copy link

@david-waterworth david-waterworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is init_weights correct? It seems to be accessing undefined local variables conv1 and conv2?

Nevermind - I didn't notice you'd merged in into the constructor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants